package cn.easy.mortgage.repository;

import cn.easy.mortgage.domain.EstateEvalInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface EstateEvalInfoDao extends PagingAndSortingRepository<EstateEvalInfo, String>, JpaSpecificationExecutor<EstateEvalInfo> {

    @Query(nativeQuery = true, value = "select * from mtg_estate_eval_info ei where ei.house_address = ?1 and ei.room_size = ?2 and DATEDIFF(ei.created_at ,NOW())=0")
    EstateEvalInfo findHouseAddressOnToday(String houseAddress, String roomSize);
}
